<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/OrderStatus/orderStatusStepTwo" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="orderStatusStepTwo" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <g:hiddenField name="docId2" value="${params.docId2}"/>
            <g:hiddenField name="stepName2" value="${params.stepName2}"/>
            <g:hiddenField name="state2" value="${params.state2}"/>
            <g:hiddenField name="partName2" value="${params.partName2}"/>
            <g:hiddenField name="lineNum2" value="${params.lineNum2}"/>
            <g:hiddenField name="group3" value="${params.group3}"/>
            <label >批次号%：</label>&nbsp;
       %{-- <g:select name="step" from="${orderStatusStepTwoLot}" data-toggle="selectpicker" data-live-search="true" optionKey="step" optionValue="step" value="${step}" noSelection="['':'ALL']" />&nbsp;--}%
            <input type="text" name="lotId" value="${lotId}">
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/OrderStatus/exportOrderWaitStep?docId1=<%=params.docId1%>&state1=<%=params.state1%>&holdState1=<%=params.holdState1%>&lineNum=<%=params.lineNum%>')" data-icon="file-excel-o" title="导出Excel">导出</button>&nbsp;
        </div>
    </form>
</div>

<div class="panel-body">
    <div style="mini-width:400px;height:450px;" id="cellGlassOutputDiv"></div>
</div>

<div class="bjui-pageContent">
    <g:if test="${orderStatusStepTwo.size() > 0}">
        <table  data-toggle="tablefixed" data-width="100%" data-nowrap="true">
            <thead>
            <tr id="t1">
                <g:each in="${tableHeadList}" status="j" var="headInstance">
                    <g:if test="${headInstance!='RN'}">
                        <th  width="125"><g:message code="${headInstance}" default="${headInstance}"/></th>
                    </g:if>
                </g:each>
            </tr>
            </thead>
            <tbody>
            <g:if test="${orderStatusStepTwo.size()>0}">
                <g:each in="${orderStatusStepTwo}" status="i" var="dataInstance">
                    <tr>
                        <g:each in="${tableHeadList}" status="j" var="headInstance">
                            <g:if test="${headInstance=='MAIN_QTY'&&headInstance!='RN'}">
                                <td name="ORDERSTEPTWOQTY${i}">${dataInstance["${headInstance}"]}</td>
                            </g:if>
                            <g:elseif test="${headInstance=='STAY_TIME'&&headInstance!='RN'}">
                                <td name="ORDERSTAYTIME${i}">${dataInstance["${headInstance}"]}</td>
                            </g:elseif>
                            <g:elseif test="${headInstance!='RN'}">
                                <td>${dataInstance["${headInstance}"]}</td>
                            </g:elseif>
                        </g:each>
                    </tr>
                </g:each>
            <tr>
                <td colspan="8">小计(当前页)</td>
                <td name="orderStepShow">0</td>
            </tr>
                <tr>
                    <td colspan="8">合计(当前页)</td>
                    <td>${orderStatusStepTwoSumQty.SUM_QTY[0]}</td>
                </tr>
            </g:if>
            <g:else>
                <g:render template="../template/emptyPanel" />
            </g:else>
            </tbody>
        </table>
    </g:if>
</div>
<g:render template="../template/51pagination" />
<script>
    $(function(){
        var orderStepTwoQty=0;
        for(var i=0;i<${orderStatusStepTwo.size()};i++){
            var steptwoqty='ORDERSTEPTWOQTY'+i
            var ordertwoQtyAdd=$("td[name='"+steptwoqty+"']").text()==''?0:parseInt($("td[name='"+steptwoqty+"']").text())
            orderStepTwoQty+=ordertwoQtyAdd


        }
        $("td[name='orderStepShow']").html(orderStepTwoQty)
//

        for(var i=0;i<${orderStatusStepTwo.size()};i++){
            var orderStayTime="ORDERSTAYTIME"+i;
            var orderJudge=parseFloat($("td[name='"+orderStayTime+"']").text())
            if(orderJudge>=1&&orderJudge<3){
                $("td[name='"+orderStayTime+"']").css("background-color","#FFFF6F")
                $("td[name='"+orderStayTime+"']").nextAll().css("background-color","#FFFF6F")
                $("td[name='"+orderStayTime+"']").prevAll().css("background-color","#FFFF6F")

            }else if(orderJudge>=3&&orderJudge<7){
                $("td[name='"+orderStayTime+"']").css("background-color","#FF9797")
                $("td[name='"+orderStayTime+"']").nextAll().css("background-color","#FF9797")
                $("td[name='"+orderStayTime+"']").prevAll().css("background-color","#FF9797")
            }else if(orderJudge>=7){
                $("td[name='"+orderStayTime+"']").css("background-color","#FF5151")
                $("td[name='"+orderStayTime+"']").nextAll().css("background-color","#FF5151")
                $("td[name='"+orderStayTime+"']").prevAll().css("background-color","#FF5151")
            }
        }
    })
</script>